/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "ctas_corrientes", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CtasCorrientes.findAll", query = "SELECT c FROM CtasCorrientes c"),
    @NamedQuery(name = "CtasCorrientes.findByIdctasCorrientes", query = "SELECT c FROM CtasCorrientes c WHERE c.idctasCorrientes = :idctasCorrientes"),
    @NamedQuery(name = "CtasCorrientes.findBySaldo", query = "SELECT c FROM CtasCorrientes c WHERE c.saldo = :saldo"),
    @NamedQuery(name = "CtasCorrientes.findByFecha", query = "SELECT c FROM CtasCorrientes c WHERE c.fecha = :fecha"),
    @NamedQuery(name = "CtasCorrientes.findByCtasCteEmi", query = "SELECT c FROM CtasCorrientes c WHERE c.ctasCteEmi = :ctasCteEmi"),
    @NamedQuery(name = "CtasCorrientes.findByCtasCteDebe", query = "SELECT c FROM CtasCorrientes c WHERE c.ctasCteDebe = :ctasCteDebe")})
public class CtasCorrientes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idctas_corrientes", nullable = false)
    private Integer idctasCorrientes;
    @Column(name = "saldo")
    private Integer saldo;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Column(name = "ctas_cte_emi")
    private Integer ctasCteEmi;
    @Column(name = "ctas_cte_debe")
    private Integer ctasCteDebe;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ctasCorrientes")
    private Collection<CtasTitular> ctasTitularCollection;

    public CtasCorrientes() {
    }

    public CtasCorrientes(Integer idctasCorrientes) {
        this.idctasCorrientes = idctasCorrientes;
    }

    public Integer getIdctasCorrientes() {
        return idctasCorrientes;
    }

    public void setIdctasCorrientes(Integer idctasCorrientes) {
        this.idctasCorrientes = idctasCorrientes;
    }

    public Integer getSaldo() {
        return saldo;
    }

    public void setSaldo(Integer saldo) {
        this.saldo = saldo;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Integer getCtasCteEmi() {
        return ctasCteEmi;
    }

    public void setCtasCteEmi(Integer ctasCteEmi) {
        this.ctasCteEmi = ctasCteEmi;
    }

    public Integer getCtasCteDebe() {
        return ctasCteDebe;
    }

    public void setCtasCteDebe(Integer ctasCteDebe) {
        this.ctasCteDebe = ctasCteDebe;
    }

    @XmlTransient
    public Collection<CtasTitular> getCtasTitularCollection() {
        return ctasTitularCollection;
    }

    public void setCtasTitularCollection(Collection<CtasTitular> ctasTitularCollection) {
        this.ctasTitularCollection = ctasTitularCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idctasCorrientes != null ? idctasCorrientes.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CtasCorrientes)) {
            return false;
        }
        CtasCorrientes other = (CtasCorrientes) object;
        if ((this.idctasCorrientes == null && other.idctasCorrientes != null) || (this.idctasCorrientes != null && !this.idctasCorrientes.equals(other.idctasCorrientes))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.CtasCorrientes[ idctasCorrientes=" + idctasCorrientes + " ]";
    }
    
}
